package com.eascs.ticket.configuration.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.eascs.ticket.common.service.BaseSevice;
import com.eascs.ticket.configuration.entity.TicketType;

@Service
public class TicketTypeService extends BaseSevice {

	public TicketType getTicketTypeById(String ticketTypeId) {
		return this.proxyDao.getById(TicketType.class, ticketTypeId);
	}

	public TicketType getTicketTypeByCode(String ticketTypeCode) {
		TicketType ticketType = new TicketType();
		ticketType.setCode(ticketTypeCode);
		return this.proxyDao.findEntityWithAny(ticketType);
	}

	public List<Object[]> getTicketTypeDataSource() {
		return this.proxyDao.findObjectsList("select code,name from ticket_type order by order_code");
	}

	public List<Object[]> getAllTicketType() {
		return this.proxyDao.findObjectsList("select id, code,name,comments from ticket_type order by order_code");
	}

}
